var Client = require('mysql').Client;
var client = new Client();
var TEST_DATABASE = 'nodejs_mysql_test';
var TEST_TABLE = 'test';  


client.user = 'root';  
client.password = 'mqywd';  
client.connect();  
client.query('USE '+TEST_DATABASE);  

var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.write('Hello World\n');

var query = client.query(  
'INSERT INTO1 '+TEST_TABLE+' '+  
'SET title = ?, text = ?, created = ?',  
['another entry', 'because 2 entries make a better test', '2010-08-16 12:42:15']
,
function selectCb(err, results, fields) {   
    if (err) {   
      res.write('okss\n');
    }  
    else
    {
        res.write('okssss\n');
    }
    client.end();  
    }
);  

if(query)
{
res.write('ok\n');
}
else
{
res.write('no\n');
}
res.end();
}).listen(1337, "127.0.0.1");